import re

with open('from.txt', 'r', encoding='utf-8') as f:
    lines = f.readlines()
text = ''.join(lines)

pattern = r'\b[a-zA-Z]+\b'
to_txt = re.findall(pattern, text)
to_txt_sorted = sorted(to_txt)
new_list = [item + '\n' for item in to_txt_sorted]

with open('to.txt','w',encoding='utf-8') as f:
    f.writelines(new_list)
